﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class viewCardDetails : System.Web.UI.Page
{
    private bussiness bus;
    string id;
    protected void Page_Load(object sender, EventArgs e)
    {
        id = Request.QueryString["id"];
        if(!IsPostBack)
        {
            if (Session["sent_details"] != null)
            {
                SentEcard se =(SentEcard) Session["sent_details"];
                lbltitle.Text = se.Title;
                lblmessage.Text = se.Massage;
                lblSignature.Text = se.Signature;
            }
           
            bus = new bussiness();
           
            List<Ecard> lstEcard = bus.getAllEcard();
            List<Ecard> lstEcard_display = new List<Ecard>();
            foreach (Ecard ecard in lstEcard)
            {
                if (ecard.EcardId == Convert.ToInt32(id))
                {
                    lstEcard_display.Add(ecard);
                    Repeater1.DataSource = lstEcard_display;
                    Repeater1.DataBind();
                    break;
                }
            }
        }
       
    }
    protected void btnBack_Click(object sender, EventArgs e)
    {
        string url = "sentEcard.aspx?id="+id+"";
        Response.Redirect(url);
    }
}